import { http } from "@/utils/http";
import { baseUrlApi, type Result, type ListResult } from "@/utils/apiPublic";
import { BaseApi } from "../base";

/** 角色列表 */
export const getRoleList = (data?: object) => {
  return http.request<ListResult>("post", baseUrlApi("admin/role/list"), {
    data
  });
};
/** 角色新增/更新 */
export const roleSave = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("admin/role/save"), {
    data
  });
};
/** 角色删除 */
export const roleDelete = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("admin/role/delete"), {
    data
  });
};

export const roleApi = new BaseApi('admin/role');